<?php
	if(isset($servers) && count($servers) > 0){ 
?>
	<?php echo form_open('admin/cirpho/settings', array('class' => 'select-server-form', 'id' => 'select-server-form', 'name' =>'select-server-form')); ?>
		<select id="select-server" name="server">
			<option value="0"><?php echo lang('cirpho_setting_choose_server')?></option>
	<?php
		foreach ($servers as $server){
	?>
	<?php
			if(isset($selectedServer) && ($selectedServer != null) && ($selectedServer->id == $server->id)){
	?>
			<option selected="selected" value="<?php echo $server->id?>"><?php echo $server->name?></option>
	<?php 
			}else{
	?>
			<option value="<?php echo $server->id?>"><?php echo $server->name?></option>
	<?php
			}
	?>
	<?php
		} 
	?>
		</select>
	<?php echo form_close(); ?>
<?php
	}
?>
<?php
if(isset($selectedServer) && $selectedServer != null){
?>
	<iframe style="width: 100%; height: 600px;" src="http://<?php echo $selectedServer->domain_name?>/index.php/cirpho/servers"></iframe> 
<?php
}else{
?>


<?php echo form_open(site_url('admin/cirpho/settings'), 'class="crud" id="settings"'); ?>

<fieldset>
	<ol>
		<li class="even">
		<label for="minimum_matching_rate"><?php echo lang('cirpho_setting_minimum_matching_rate');?></label>
		<?php echo  form_input('minimum_matching_rate', $minimum_matching_rate->value); ?>
		<span class="required-icon tooltip"><?php echo lang('required_label');?></span>
		<span class=""><?php echo lang('cirpho_setting_percent');?></span>
		</li>
		<li class="odd">
		<label for="decision_matching_rate"><?php echo lang('cirpho_setting_decision_matching_rate');?></label>
		<?php echo  form_input('decision_matching_rate', $decision_matching_rate->value); ?>
		<span class="required-icon tooltip"><?php echo lang('required_label');?></span>
		<span class=""><?php echo lang('cirpho_setting_percent');?></span>
		</li>
	</ol>
	<div class="buttons float-left padding-top">
		<?php $this->load->view('admin/partials/buttons', array('buttons' => array('save', 'cancel') )); ?>
	</div>
</fieldset>

<?php echo form_close(); ?>

<?php echo form_open(site_url('admin/cirpho/settings'), 'class="crud" id="rebuild"'); ?>

<fieldset>
	<ol>
		<li class="even">
		<label for="max_width"><?php echo lang('cirpho_setting_max_width');?></label>
		<?php echo  form_input('max_width', $max_width->value); ?>
		<span class="required-icon tooltip"><?php echo lang('required_label');?></span>
		<span class=""><?php echo lang('cirpho_setting_px');?></span>
		</li>
		<!-- 
		<li class="odd">
		<label for="max_height"><?php echo lang('cirpho_setting_max_height');?></label>
		<?php echo  form_input('max_height', $max_height->value); ?>
		<span class="required-icon tooltip"><?php echo lang('required_label');?></span>
		<span class=""><?php echo lang('cirpho_setting_px');?></span>
		</li>
		 -->
	</ol>
	<div class="buttons float-left padding-top">
		<?php echo form_button(array('name'=>'rebuild','class'=>'button','value'=>lang('cirpho_setting_rebuild'),'type'=>'submit','content'=>'<span>'.lang('cirpho_setting_rebuild').'</span>')); ?>
		<?php $this->load->view('admin/partials/buttons', array('buttons' => array('cancel') )); ?>
	</div>
</fieldset>

<?php echo form_close(); ?>

<?php
} 
?>